package com.guiwu.gteway.industryapp.util;

import android.app.ProgressDialog;
import android.content.Context;

/**
 * Created by 乔冠 on 2017/12/21. 简单进度显示与关闭
 */

public class ProgressSimpleDialog {
    private ProgressDialog mDialog;
    private Context context;

    public ProgressSimpleDialog(Context context){
        this.context = context;
    }


    /**
     * 显示对话框
     * @param message
     */
    public boolean showPorgressDialog(String message){
        if (mDialog == null){
            mDialog = new ProgressDialog(context);
            mDialog.setMessage(message);
            mDialog.setCanceledOnTouchOutside(false);
        }
        mDialog.show();
        return true;
    }

    /**
     * 关闭对话框
     */
    public boolean closeProgressDialog(){
        if (mDialog != null){
            mDialog.dismiss();
        }
        return false;
    }


    public boolean isShow(){
        if (mDialog != null){
            return mDialog.isShowing();
        }else
            return false;
    }

}
